﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BartonExtension;

namespace WSServer
{
    public static class WSTokenManager
    {
        public static void AssignAccessCodeToSocket(this WSSocket socket)
        {
            WSAccessToken acs_token = new WSAccessToken((acs) =>
            {
                socket.onTokenExpired(acs);
            })
            {
                access_token = IDGenerator.GenerateID().ToString(),
                createTime = DateTime.Now
            };
            socket.token = acs_token;
        }
    }
}
